package com.youkeyi.ddy.cloud.common.api.application.business.crm.type;

import com.youkeyi.ddy.cloud.common.api.application.business.crm.type.dto.BusinessCustomerTypeListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.business.crm.type.param.BusinessCustomerTypeCreateCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.crm.type.param.BusinessCustomerTypeDeleteCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.crm.type.param.BusinessCustomerTypeListCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.crm.type.param.BusinessCustomerTypeUpdateCloudParam;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 客户类型
 *
 * @Serveror liuxiawang
 * @Date 5/24/22 10:36 PM
 * @Location shenzhen.china
 */
@Api(tags = {"【BUSINESS】Customer Type Management"})
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-APPLICATION-BUSINESS", fallback = BusinessCustomerTypeCloudServiceFallback.class)
@RequestMapping("/business/customer/type")
public interface BusinessCustomerTypeCloudService {

    // 查询客户类型列表
    @ApiOperation(value = "Query Customer Type List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.crm.type.BusinessCustomerTypeCloudService.list")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = BusinessCustomerTypeListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query Customer Type List", dataType = "BusinessCustomerTypeListCloudParam", dataTypeClass = BusinessCustomerTypeListCloudParam.class),
    })
    @GetMapping
    public abstract BusinessCustomerTypeListCloudDto list(BusinessCustomerTypeListCloudParam param);

    // 创建客户类型
    @ApiOperation(value = "Create Customer Type", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.crm.type.BusinessCustomerTypeCloudService.create")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Create Customer Type", dataType = "BusinessCustomerTypeCreateCloudParam", dataTypeClass = BusinessCustomerTypeCreateCloudParam.class),
    })
    @PostMapping("/create")
    public abstract ResponseContent create(@RequestBody BusinessCustomerTypeCreateCloudParam param);


    // 编辑客户类型
    @ApiOperation(value = "Update Customer Type", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.crm.type.BusinessCustomerTypeCloudService.update")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Update Customer Type", dataType = "BusinessCustomerTypeUpdateCloudParam", dataTypeClass = BusinessCustomerTypeUpdateCloudParam.class),
    })
    @PatchMapping("update")
    public abstract ResponseContent update(@RequestBody BusinessCustomerTypeUpdateCloudParam param);


    // 删除客户类型
    @ApiOperation(value = "Delete Customer Type", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.crm.type.BusinessCustomerTypeCloudService.delete")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Delete Customer Type", dataType = "BusinessCustomerTypeDeleteCloudParam", dataTypeClass = BusinessCustomerTypeDeleteCloudParam.class),
    })
    @DeleteMapping("/delete")
    public abstract ResponseContent delete(BusinessCustomerTypeDeleteCloudParam param);

}
